FROM  docker.io/centos
ADD   apache-tomcat-8.5.20.tar.gz /usr/local/
ADD   jdk-7u76-linux-x64.tar.gz  /usr/local/
COPY  target/maven.war    /usr/local/apache-tomcat-8.5.20/webapps/
COPY logging.properties    /usr/local/apache-tomcat-8.5.20/conf/
ADD  catalina.sh          /usr/local/apache-tomcat-8.5.20/bin/
ADD   server.xml          /usr/local/apache-tomcat-8.5.20/conf/
ADD  logstash-5.3.1.tar       /opt/
ADD   jdk1.8.0_131.tar        /opt/
ADD   logstash.sh         /opt/logstash-5.3.1/
ADD   log4j_go.conf       /opt/logstash-5.3.1/
COPY supervisord.conf /etc/supervisord.conf
RUN  yum install epel-release -y
RUN  yum install -y  supervisor

ENV   JAVA_HOME  /usr/local/jdk1.7.0_76/
ENV   JRE_HOME   /usr/local/jdk1.7.0_76/jre
#ENV   JAVA_HOME  /opt/jdk1.8.0_131/
#ENV   JRE_HOME   /opt/jdk1.8.0_131/jre

EXPOSE  8080

RUN chmod 775  /usr/local/apache-tomcat-8.5.20/bin/catalina.sh
RUN chmod 775  /opt/logstash-5.3.1/logstash.sh
CMD            ["/usr/bin/supervisord"]


#RUN            /opt/logstash-5.3.1/logstash.sh
#CMD    /usr/local/apache-tomcat-8.5.20/bin/catalina.sh run
#CMD    /opt/logstash-5.3.1/bin/logstash  -f   /opt/logstash-5.3.1/log4j_go.conf
#RUN    /opt/logstash-5.3.1/bin/logstash  -f   /opt/logstash-5.3.1/log4j_go.conf
